﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>上传或选择互联网文档</title>
</head>
<body>
  <div class="documentSelector">

    <script>

      function show(type)
      {
        if (type == "Internet")
        {
          document.getElementById('url').style.display = 'inline';

          if (document.getElementById('url').value == "")
            document.getElementById('url').value = "http://";

          document.getElementById('file').style.display = 'none';
        }
        else
        {
          document.getElementById('url').style.display = 'none';
          document.getElementById('file').style.display = 'inline';
        }
      }

    </script>

    <form method="post" action="Default" controller enctype="multipart/form-data">

      <div>
        <select name="type" onchange="show( this.value );">
          <option value="Internet">Internet</option>
          <option value="Local">Local</option>
        </select>
        <input id="url" name="url" type="url" style="width: 300px;" value="http://" />
        <input id="file" name="file" type="file" style="width: 300px; display: none;" />
        <select name="encoding">
          <option>UTF-8</option>
          <option>GB2312</option>
        </select>
        <input type="submit" value="开始分析" />
      </div>
    </form>

    <view var="type" key="Type"></view>
    <view var="url" key="Url"></view>
    <script>
      if (type != null)
      {
        document.getElementsByName("type")[0].value = type;
        document.getElementsByName("url")[0].value = url;
      }

      show(document.getElementsByName("type")[0].value);


    </script>
  </div>

</body>
</html>
